﻿USE HRB
GO

SET IDENTITY_INSERT [dbo].[hrbLanguages] ON
INSERT INTO [dbo].[hrbLanguages] ([LanguageID], [Name], [Code], [IsActive]) VALUES (1, N'Tiếng Việt', 'vi', 1)
INSERT INTO [dbo].[hrbLanguages] ([LanguageID], [Name], [Code], [IsActive]) VALUES (2, N'English', 'en', 1)
SET IDENTITY_INSERT [dbo].[hrbLanguages] OFF
GO

DECLARE @catID uniqueidentifier;
SET @catID = '5d6c061e-6c0f-484b-a51c-322c09a48637';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'[Không Phân Loại]', N'Loại mặc định', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'[General]', N'General category', NULL, 2)
SET @catID = '792ad48a-3bec-4565-8600-5f9162e4b474';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Nhu Cầu Cấp Thiết', N'Nhu cầu cấp thiết', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Needings', N'Needings', NULL, 2)
SET @catID = '8a6985e8-acf5-4107-beab-af1f6bba9104';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Văn Thư Chỉ Thị', N'Văn Thư Chỉ Thị', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Documents', N'Documents', NULL, 2)
SET @catID = '738a6876-1003-435e-8061-1f13adc8f6e5';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Nội Dung Hoạt Động', N'Nội Dung Hoạt Động', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Activities', N'Activities', NULL, 2)
SET @catID = '6f20049e-3c2e-4068-96b0-5cd15e67f301';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Kiến Thức Y Học', N'Kiến Thức Y Học', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Knowledge', N'Knowledge', NULL, 2)
SET @catID = '3c2a2d2a-52ad-4b3c-a635-f3bd2900e443';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Tin Trong Nước', N'Tin Tức Trong Nước', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'National News', N'National News', NULL, 2)
SET @catID = '0e573537-7ab7-46c1-bcb7-90663a50abd7';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Tin Nước Ngoài', N'Tin Nước Ngoài', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'International News', N'International News', NULL, 2)
SET @catID = '6d1876ac-de48-4570-aa99-6479fd4b2fec';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Gương Điển Hình', N'Gương Điển Hình', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Heroes', N'Heroes', NULL, 2)
SET @catID = '183bfcf8-abfe-40b2-9b7b-784d8fa84ea0';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Blog', N'Blog', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Blog', N'Blog', NULL, 2)
SET @catID = '2e9e24b0-c419-48ec-91c0-1bdbb43a8500';
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Hỏi & Đáp', N'Hỏi & Đáp', NULL, 1)
INSERT INTO [dbo].[hrbCategories] ([CategoryID], [CategoryName], [Description], [ParentID], [LanguageID]) VALUES (@catID, N'Q & A', N'Q & A', NULL, 2)

--Không Phân Loại - General
--Nhu Cầu Cấp Thiết - Needings
--Văn Thư Chỉ Thị - Documents
--Nội Dung Hoạt Động - Activities
--Kiến Thức Y Học - Knowledge
--Gương Điển Hình - Heroes
--Blog - Blog
--Hỏi & Đáp - Q & A
--Nhu Cầp Cấp Thiết - Needings
GO

SET IDENTITY_INSERT [dbo].[hrbUsers] ON
INSERT INTO [dbo].[hrbUsers] ([UserID], [UserName], [Password], [LastLoginTime], [EmailAddress]) VALUES (1, 'admin' ,'', NULL, NULL)
SET IDENTITY_INSERT [dbo].[hrbUsers] OFF
GO

SET IDENTITY_INSERT [dbo].[hrbRoles] ON
INSERT INTO [dbo].[hrbRoles] ([RoleID], [Role]) VALUES (1, 'Administrators')
INSERT INTO [dbo].[hrbRoles] ([RoleID], [Role]) VALUES (2, 'Specialists')
SET IDENTITY_INSERT [dbo].[hrbRoles] OFF
GO

SET IDENTITY_INSERT [dbo].[hrbUserRoles] ON
INSERT INTO [dbo].[hrbUserRoles] ([UserRoleID], [UserID], [RoleID]) VALUES (1, 1, 1)
SET IDENTITY_INSERT [dbo].[hrbUserRoles] OFF
GO

INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('administratorrole', 'Administrators')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('alternatefeedurl', '')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('culture', 'vi')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('compresswebresource', 'False')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('email', 'user@example.com')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('emailsubjectprefix', 'Rare Blood Group')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('enablehttpcompression', 'True')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('enablereferrertracking', 'False')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('enablessl', 'True')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('fileextension', '.aspx')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('httpheader', '')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('handlewwwsubdomain', '')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('language', 'vi')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('sendmailoncomment', 'True')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('smtppassword', 'password')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('smtpserver', 'mail.example.dk')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('smtpserverport', '25')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('smtpusername', 'user@example.com')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('storagelocation', '~/App_Data/')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('timestamppostlinks', 'True')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('timezone', '0')
INSERT INTO [dbo].[hrbSetting] ([SettingName], [SettingValue]) VALUES ('trackingscript', '')

GO

DECLARE @pageID uniqueidentifier;
SET @pageID = NEWID();
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('66107a88-1fa8-407a-ad29-2106c998e027'
           ,N'Giới Thiệu Tổ Chức'
           ,N'Giới thiệu về tổ chức.'
           ,N'[Nội dung]'
           ,N'Giới thiệu tổ chức'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'GioiThieuToChuc')
		  
SET @pageID = NEWID();		  
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('66107a88-1fa8-407a-ad29-2106c998e027'
           ,N'Introducing Organization'
           ,N'Introducing about organization.'
           ,N'[Content]'
           ,N'Introducing organization'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'Introducing')

INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('4b3ac5c7-de7a-4545-aaf9-c3a876127d06'
           ,N'Lời Nói Đầu'
           ,N'Lời nói đầu.'
           ,N'[Nội dung]'
           ,N'Lời nói đầu'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'LoiNoiDau')
		   	   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('4b3ac5c7-de7a-4545-aaf9-c3a876127d06'
           ,N'Foreword'
           ,N'Foreword.'
           ,N'[Content]'
           ,N'Foreword'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'Foreword')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('7abac4a6-3fe7-4328-a75b-fa160d1582ec'
           ,N'Mục Tiêu'
           ,N'Mục tiêu.'
           ,N'[Nội dung]'
           ,N'Mục Tiêu'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'MucTieu')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('7abac4a6-3fe7-4328-a75b-fa160d1582ec'
           ,N'Objectives'
           ,N'Objectives.'
           ,N'[Content]'
           ,N'Objectives'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'Objectives')
	
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('dd1c5f17-d3a1-4e2b-9803-21093c3afd70'
           ,N'Danh Sách Thành Viên'
           ,N'Danh sách thành viên.'
           ,N'[Nội dung]'
           ,N'Danh Sách'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'DanhSachThanhVien')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('1BD998BA-C973-471E-90E4-FA862F6DD3B8'
           ,N'Danh Sách Ân Nhân'
           ,N'Danh sách ân nhân.'
           ,N'[Nội dung]'
           ,N'Danh Sách'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'DanhSachAnNhan')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('68E8EB18-E20B-4398-978C-1A77F13F10F7'
           ,N'Danh Sách Nhà Tài Trợ'
           ,N'Danh sách nhà tài trợ.'
           ,N'[Nội dung]'
           ,N'Danh Sách'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,1
           ,NULL
           ,'DanhSachNhaTaiTro')
	
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('dd1c5f17-d3a1-4e2b-9803-21093c3afd70'
           ,N'Member List'
           ,N'MemberList.'
           ,N'[Content]'
           ,N'MemberList'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'MemberList')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('1BD998BA-C973-471E-90E4-FA862F6DD3B8'
           ,N'Hero List'
           ,N'HeroList.'
           ,N'[Content]'
           ,N'HeroList'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'HeroList')
		   
INSERT INTO [dbo].[hrbPage]
           ([PageID]
           ,[Title]
           ,[Description]
           ,[PageContent]
           ,[Keywords]
           ,[DateCreated]
           ,[DateModified]
           ,[IsPublished]
           ,[LanguageID]
           ,[ParentID]
           ,[Slug])
     VALUES
           ('68E8EB18-E20B-4398-978C-1A77F13F10F7'
           ,N'Sponsor List'
           ,N'SponsorList.'
           ,N'[Content]'
           ,N'SponsorList'
           ,'11/10/2009'
           ,'11/10/2009'
           ,'True'
           ,2
           ,NULL
           ,'SponsorList')
		   
GO


IF NOT EXISTS (Select * from dbo.sysobjects where id=object_id('_TMP_SCRIPT_EXECUTION') and OBJECTPROPERTY(id,'IsUserTable')=1)
	CREATE TABLE [_TMP_SCRIPT_EXECUTION]([Id] int identity(1,1) NOT NULL, 
														[RunTime] DATETIME NOT NULL, 
														[Script] varchar(50) NOT NULL, 
														[Version] varchar(20) NOT NULL,
														[Descr] nvarchar(200) NULL);

GO
INSERT INTO [_TMP_SCRIPT_EXECUTION]([RunTime],[Script], [Version], [Descr]) VALUES(GetDate(), '3.InitData', '1.0.9330.1', 'Init database')